<?php
$session=new CHttpSession();
$session->open();
$i=$session['i'];
?>
    <tr<?php echo $i%2==1 ? '': ' class="tr1"'; ?>>
        <td align="center" class="td1<?php echo $i%2==1 ? '': ' td2'; ?>">
                <?php echo $data->id;?>
        </td>
        <td align="center" class="ms td1<?php echo $i%2==1 ? '': ' td2'; ?>"><?php echo $data->title;?></td>
        <td align="center" class="ms td1<?php echo $i%2==1 ? '': ' td2'; ?>"><?php
            if($data->post_uid==Yii::app()->user->id){
                echo $data->status==0?'新建':($data->status==1?'有应答':($data->status==2?'已经回复':'未知'));
            }else{
                echo $data->status==0?'新建':($data->status==2?'有应答':($data->status==1?'已经回复':'未知'));
            }
            ?></td>
        <td align="center" class="ms td1<?php echo $i%2==1 ? '': ' td2'; ?>"><?php echo $data->post_uid==Yii::app()->user->id ? '发出消息' : '收到消息';?></td>
        <td align="center"<?php echo $i%2==1 ? '': ' class="td2"'; ?>>
            <input type="button" value="查看" onclick="window.location='/index.php?r=manage/index&cate=15&id=<?php echo $data->id;?>';" />
            |
            <input type="button" value="删除" onclick="if(confirm('删除后无法回复，确认删除此消息？')){window.location='/index.php?r=manage/delmsg&id=<?php echo $data->id;?>';};" />
        </td>
    </tr>
<?php
$session['i']=$i+1;
?>